fix: if you type /bp now, the latest applied filters are still there (menu doesn't reset anymore)#73
fix: if you type /bp now, the latest applied filters are still there (menu doesn't reset anymore)#73Jasupa wants to merge 2 commits intoBuildTheEarth:buildfrom
Conversation
…(menu doesn't reset anymore)
There was a problem hiding this comment.
Pull request overview
This PR fixes the block palette menu behavior so that typing /bp now retains the previously applied filters instead of resetting to defaults. It also introduces /bp menu as an explicit command to reset filters to defaults.
Changes:
- Modified command structure to differentiate between
/bp(remembers filters) and/bp menu(resets to defaults) - Swapped primary command name from
blockpalettetobpin plugin.yml, making the shorter alias the primary command - Added null safety check in ModuleHandler to prevent NullPointerException when disabled modules list is null
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main/resources/plugin.yml | Changed primary command from blockpalette to bp, updated aliases and usage text |
| src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java | Split /bp and /bp menu logic to support filter persistence vs reset behavior, updated help message |
| src/main/java/net/buildtheearth/modules/ModuleHandler.java | Added null check for disabled modules list to prevent potential NullPointerException |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/resources/plugin.yml
Outdated
| bp: | ||
| description: Opens the block palette menu. | ||
| usage: /blockpalette [filter|menu|filter <filter1> <filter2> ...] | ||
| aliases: [bp, blocks] | ||
| usage: /bp [filter|menu|filter <filter1> <filter2> ...] | ||
| aliases: [blockpalette, blocks] |
There was a problem hiding this comment.
The command registration in MiscModule.java uses "blockpalette", but plugin.yml now defines "bp" as the primary command with "blockpalette" as an alias. While this should still work functionally (since aliases are registered), it creates inconsistency. Consider updating the registration to use "bp" to match the new primary command name in plugin.yml.
Zoriot
left a comment
There was a problem hiding this comment.
Generally it seems to you have some unrelated changes which i made (possibly) in there.
Would be great if you can fix them. Create a new branch from build, cherry pick your commit(s), fix stuff like the imports and push it into this branch.
Should be easier then manually fixing everything
| @@ -1,8 +1,7 @@ | |||
| name: BuildTeamTools | |||
| main: net.buildtheearth.buildteamtools.BuildTeamTools | |||
There was a problem hiding this comment.
Revert this change. Else it will not work at all
| version: ${version} | ||
| description: ${description} |
There was a problem hiding this comment.
Revert your changes here too, we want to use the version from the build script
| usage: /warpsbt <team> | ||
| aliases: [ wbt, wpt, warpsbuildteam, warpsbt ] | ||
| aliases: [ wbt ] | ||
| kml: |
There was a problem hiding this comment.
Why have this changes been made? Revert them pls
| createplot: | ||
| description: Creates a new plot for the PlotSystem. | ||
| usage: /createplot | ||
| permission: plotsystem.createplot | ||
| pasteplot: | ||
| description: Pastes a plot manually with specific ID | ||
| usage: /pasteplot <ID> | ||
| permission: plotsystem.pasteplot | ||
| plotsystemterra: | ||
| description: Sends info about the plugin | ||
| usage: /plotsystemterra |
There was a problem hiding this comment.
Don't read this commands, plot system module is currently disabled/no there and we should not register any cmds
| @@ -1,17 +1,18 @@ | |||
| package net.buildtheearth.buildteamtools.modules; | |||
| package net.buildtheearth.modules; | |||
There was a problem hiding this comment.
Nope, structure change to include the btt namespace so revert this lines
Also fix the imports under that
| for (Module m : modules) | ||
| registerModule(m); | ||
| for (Module m : modules) { | ||
| if (!Objects.requireNonNull(BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES)).contains(m.getModuleName())) { |
There was a problem hiding this comment.
Revert this change, it's unrelated
…(menu doesn't reset anymore)